package com;

public class AnonymousClass {
    interface Operate{
        int plus(int a,int b);
        int sub(int a,int b);
    }

    void operate(int a,int b,Operate operate){
        System.out.println(a+"+" +b +" = "+operate.plus(a,b));
        System.out.println(a+"-" +b +" = "+operate.sub(a,b));
    }

    public static void main(String[] args){
        new AnonymousClass().operate(1, 2, new Operate() {
            @Override
            public int plus(int a, int b) {
                return a+b;
            }

            @Override
            public int sub(int a, int b) {
                return a-b;
            }
        });
    }
}
